var webPath = "";
$(document).ready(function(){
	webPath = $("#webPath").val();
	var msg = $("#message").val();
	if(msg != ""){
		alert(msg);
	}
});

function saveCommunity(){
	var communityName = $("#communityName").val();
	if(string.trim(communityName) == ""){
		alert("请输入社区名称！");
		return false;
	}
	var method = $("#method").val();
	if(method == ""){
		method = "add";
	}
	document.form1.action = webPath + "/admin/community!"+method+".action";
	document.form1.submit();
}

function del(communityId){
	if(communityId == ""){
		alert("请选择一条记录！");
		return false;
	}
	var question = confirm("确定删除吗？");
	if(question){
		$("#communityId").val(communityId);
		document.form1.action = webPath + "/admin/community!del.action";
		document.form1.submit();
	}
}

function initUpdate(communityId){
	if(communityId == ""){
		alert("请选择一条记录！");
		return false;
	}
	$("#communityId").val(communityId);
	document.form1.action = webPath + "/admin/community!initUpdate.action";
	document.form1.submit();
}